//
//  UITextField+DDUITextFieldCategory.m
//  DDMusic
//
//  Created by rimi on 16/11/6.
//  Copyright © 2016年 FengBaoFamily. All rights reserved.
//

#import "UITextField+DDUITextFieldCategory.h"

@implementation UITextField (DDUITextFieldCategory)
+ (instancetype)dd_creatTextFieldWithPlaceHolder:(NSString*)placeHolder font:(CGFloat)font textColor:(UIColor*)textColor leftView:(UIView*)leftView isShowClearButton:(BOOL)isShowClearButton rightView:(UIView*)rightView{
    UITextField* textField = [[UITextField alloc]init];
    if (placeHolder!=nil) {
        textField.placeholder = placeHolder;
    }
    if (font!=0) {
        textField.font = [UIFont systemFontOfSize:font];
    }
    if (textColor!=nil) {
        textField.textColor = textColor;
    }
    if (leftView!=nil) {
        textField.leftView = leftView;
        textField.leftViewMode = UITextFieldViewModeAlways;
    }
    if (isShowClearButton == YES) {
        textField.clearButtonMode= UITextFieldViewModeWhileEditing;
    }
    if (rightView!=nil) {
        textField.rightView = rightView;
        textField.rightViewMode = UITextFieldViewModeWhileEditing;
    }
    return textField;
    
}
@end
